package com.vd.tbsms.ui;

import java.awt.Color;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class ErrorTableCellRenderer extends DefaultTableCellRenderer{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<Integer> list = new ArrayList<Integer>();
	@Override
	public Component getTableCellRendererComponent(JTable table,
			Object value, boolean isSelected, boolean hasFocus,
			int row, int column) {
		Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
		if(list.contains(row)){
			comp.setBackground(Color.RED);
		}else{
			comp.setBackground(Color.WHITE);
		}
        return comp;
	}
	public void addRow(int row){
		this.list.add(row);
	}

}
